package com.dut.bbs.extend.treeview;

/**
 * 类名：TreeElement.java
* 类描述：树形结构节点类
 */
public class TreeElement {
    /**
     * 当前节点id
     * 格式如：1011，表示根节点的第一个子节点的一层一号元素；
     * 1021，表示根节点第一个子节点的二层一号元素
     * 3022，表示根节点第三个子节点的二层二号元素
     * ...以此类推
     */
    String id = "";// 当前节点id
    String title = "";// 当前节点文字
    boolean hasParent = false;// 当前节点是否有父节点
    boolean hasChild = false;// 当前节点是否有子节点
    String parentId = "";// 父节点id
    int level = -1;// 当前界面层级
    boolean fold = false;// 是否处于展开状态
    String url = "";// 拉去数据的网址
    boolean loadedChild = false;// 当前节点子节点数据是否已拉去
 
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
       this.id = id;
    }
 
    public String getTitle() {
       return title;
    }
 
    public void setTitle(String title) {
       this.title = title;
    }
 
    public boolean isHasParent() {
       return hasParent;
    }
 
    public void setHasParent(boolean hasParent) {
       this.hasParent = hasParent;
    }
 
    public boolean isHasChild() {
       return hasChild;
    }
 
    public void setHasChild(boolean hasChild) {
       this.hasChild = hasChild;
    }
 
    public String getParentId() {
       return parentId;
    }
 
    public void setParentId(String parentId) {
       this.parentId = parentId;
    }
 
    public int getLevel() {
       return level;
    }
 
    public void setLevel(int level) {
       this.level = level;
    }
 
    public boolean isFold() {
       return fold;
    }
 
    public void setFold(boolean fold) {
       this.fold = fold;
    }
    
    public String getUrl() {
    	return url;
    }
    
    public void setUrl(String url) {
    	this.url = url;
    }
    
    public boolean isLoadedChild() {
    	return loadedChild;
    }
    
    public void setLoadedChild(boolean loadedChild) {
    	this.loadedChild = loadedChild;
    }
 
    @Override
    public String toString() {
       return "id:" + this.id + "-level:" + this.level + "-title:"
              + this.title + "-fold:" + this.fold + "-hasChild:"
              + this.hasChild + "-hasParent:" + this.hasParent + "-parentId:"+ this.parentId
              + "-url:" + this.url + "-loadedChild:" + loadedChild;
    }
}